#include <visa.h>
//==============================================================================
//
// Title:       Visa_SigAmplifier.c
// Purpose:     A short description of the implementation.
//
// Created on:  10/20/2008 at 12:56:37 PM by Ricardo Santa Olalla.
// Copyright:   NI. All Rights Reserved.
//
//==============================================================================

//==============================================================================
// Include files

//#include "visa_shared_memory.h"

//==============================================================================
// Constants

//==============================================================================
// Types

//==============================================================================
// Static global variables

//==============================================================================
// Static functions

//==============================================================================
// Global variables

//==============================================================================
// Global functions


void SigAmplification_loop (ViSession handle, ViBusAddress off)
{
	int i =0;
	ViUInt8 stop = 0;
	ViUInt8 Gain = 1;
	ViBusAddress stop_reg= off;
	ViBusAddress data_regs = off + 10;
	ViBusAddress data_amp_regs = off + 111;
	ViBusAddress gain_reg = off + 1;
	ViUInt8 Data[100];
	viIn8(handle,VI_PXI_ALLOC_SPACE, stop_reg,& stop);
	while (stop <=0)
	{ 
		viMoveIn8(handle, VI_PXI_ALLOC_SPACE, data_regs,100, Data);
		viIn8(handle, VI_PXI_ALLOC_SPACE, gain_reg, & Gain);
		for (i=0;i<100;i++)
			Data[i] = Data[i] * Gain;
		viMoveOut8(handle, VI_PXI_ALLOC_SPACE, data_amp_regs, 100,Data);
		viIn8(handle,VI_PXI_ALLOC_SPACE, stop_reg,& stop);
	}
}

